﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ENail.Domain.Core;
using ENail.Domain.Core.Contract.Services;
using ENail.Portal.Web.Models;
using Equation.Enterprise.Framework.Web.Model;

namespace ENail.Portal.Web.Controllers
{
    public class TaskManager
    {
        private ITaskService _service;
        private ListViewModelMapper<TaskListViewItem, Task> _listMapper;
        private GenericListViewModel<TaskListViewItem> viewModel;

        public TaskManager(ITaskService service)
        {
            _service = service;

        }
        public GenericListViewModel<TaskListViewItem> GetTaskModel()
        {
            _listMapper = new TaskListViewModelMapper();
            List<Task> domainModel = _service.GetTask(System.DateTime.Now).ToList();
            GenericListViewModel<TaskListViewItem> viewModel = new GenericListViewModel<TaskListViewItem>();
            _listMapper.MapDomainToView(domainModel, viewModel);
            return viewModel;
        }
    }
}